home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / Development / PartMaker / Container•1.0d11v2 / Container•1.0d11v2.rsrc / dFRK_5078 < prev    next >
Encoding:
Text File  |  1995-12-08  |  3.6 KB  |  118 lines

  1. //========================================================================================
  2. //
  3. //    File:                ContainerDDCmd.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Author:                Mary Boetcher
  7. //
  8. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef CONTAINERDDCMD_H
  13. #define CONTAINERDDCMD_H
  14.  
  15. // ----- FrameWork Includes -----
  16.  
  17. #ifndef FWDRCMD_H
  18. #include "FWDrCmd.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. //    Forward Declarations
  23. //========================================================================================
  24.  
  25. #if FW_LIB_EXPORT_PRAGMAS
  26. #pragma lib_export on
  27. #endif
  28. class FW_CLASS_ATTR ODDragItemIterator;
  29. class FW_CLASS_ATTR FW_CFrame;
  30. class FW_CLASS_ATTR FW_CPrivOrderedCollection;
  31. #if FW_LIB_EXPORT_PRAGMAS
  32. #pragma lib_export off
  33. #endif
  34.  
  35. class FW_CLASS_ATTR CContainerPart;
  36. class FW_CLASS_ATTR CContainerSelection;
  37. class FW_CLASS_ATTR CContainerSubscribeLink;
  38. class FW_CLASS_ATTR CContainerLinkManager;
  39.  
  40. //========================================================================================
  41. // class CDragCommand - for dragging
  42. //========================================================================================
  43.  
  44. class FW_CLASS_ATTR CDragCommand : public FW_CDragCommand
  45. {
  46.   public:
  47.  
  48.     CDragCommand(Environment* ev, 
  49.                  CContainerPart* part,
  50.                  FW_CFrame* frame,
  51.                  CContainerSelection* selection,
  52.                  FW_Boolean canUndo);
  53.  
  54.     virtual ~ CDragCommand();
  55.  
  56.     // --- FW_CCommand overrides
  57.     virtual void UndoIt(Environment* ev);            // Override
  58.     virtual void RedoIt(Environment* ev);            // Override
  59.     virtual void SaveUndoState(Environment* ev);    // Override
  60.     virtual void FreeUndoState(Environment *ev);    // Override
  61.  
  62.   protected:
  63.     CContainerPart*            fContainerPart;
  64.     CContainerSelection*        fContainerSelection;
  65.     FW_CPrivOrderedCollection*    fClearedShapeList;
  66.  
  67.     void SelectDraggedShapes(Environment* ev);
  68. };
  69.  
  70. //========================================================================================
  71. // class CDropCommand - for dropping
  72. //========================================================================================
  73.  
  74. class FW_CLASS_ATTR CDropCommand : public FW_CDropCommand
  75. {
  76.   public:
  77.     CDropCommand(Environment* ev, 
  78.                  CContainerPart* itsPart,
  79.                  FW_CFrame* frame,
  80.                  ODDragItemIterator* dropInfo, 
  81.                  ODFacet* facet, 
  82.                  const FW_CPoint& windowPoint,
  83.                  FW_Boolean canUndo);
  84.  
  85.     virtual ~ CDropCommand();
  86.  
  87.     virtual void UndoIt(Environment* ev);            // Override
  88.     virtual void RedoIt(Environment* ev);            // Override
  89.     virtual void CommitUndone(Environment *ev);    // Override
  90.     virtual void SaveRedoState(Environment* ev);    // Override
  91.     virtual void FreeRedoState(Environment* ev);    // Override
  92.  
  93.     // --- FW_CDropCommand overrides
  94.     virtual FW_Boolean DoDrop(Environment* ev, ODStorageUnit* dropSU, const FW_CPoint& originPoint, const FW_CPoint& dropPoint, FW_Boolean isDropMove);
  95.     virtual FW_Boolean DoDroppedInSameFrame(Environment* ev, ODStorageUnit* dropSU, const FW_CPoint& originPoint, const FW_CPoint& dropPoint);
  96.     virtual void DoDroppedPasteAs(Environment* ev, 
  97.                                   const FW_CPoint& originPoint, 
  98.                                   const FW_CPoint& dropPoint);    // Override
  99.  
  100.   protected:
  101.  
  102.     void OffsetSelection(Environment* ev, const FW_CPoint& delta);
  103.     void RestoreDroppedShapes(Environment* ev);
  104.     void SelectDroppedShapes(Environment* ev);
  105.  
  106.     CContainerLinkManager* GetContainerLinkManager(Environment* ev) const;
  107.  
  108.   private:
  109.     CContainerPart*                fContainerPart;
  110.     CContainerSelection*            fContainerSelection;
  111.     FW_CPoint                fDropDelta;
  112.     FW_CPrivOrderedCollection*        fDroppedShapeList;
  113.     CContainerSubscribeLink*        fSavedLink;
  114. };
  115.  
  116.  
  117. #endif
  118.